﻿CREATE TABLE [dbo].[user_Role] (
    [Id]    UNIQUEIDENTIFIER CONSTRAINT [DF_user_Role_Id] DEFAULT (newid()) NOT NULL,
    [Email] NVARCHAR (256)   NOT NULL,
    [Role]  NVARCHAR (128)   NOT NULL,
    CONSTRAINT [PK_user_Role] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_Role_User] FOREIGN KEY ([Email]) REFERENCES [dbo].[user_User] ([Email]),
    CONSTRAINT [IX_user_Role_Uni_Email_Role] UNIQUE NONCLUSTERED ([Email] ASC, [Role] ASC)
);




GO
CREATE NONCLUSTERED INDEX [IX_user_Role]
    ON [dbo].[user_Role]([Email] ASC);

